package com.zeng.ssm.service.support.trans.server.ebank.signQuery;

import com.google.common.collect.Lists;
import com.zeng.ssm.service.support.trans.GxpConstant;
import com.zeng.ssm.service.support.trans.annotation.ClientHandler;
import com.zeng.ssm.service.support.trans.annotation.ServerHandler;
import com.zeng.ssm.service.support.trans.base.model.IBody;
import com.zeng.ssm.service.support.trans.server.base.BaseGxpServerHandler;
import com.zeng.ssm.service.support.trans.server.ebank.signQuery.model.in.SignQueryInput;
import com.zeng.ssm.service.support.trans.server.ebank.signQuery.model.out.AcctNoItem;
import com.zeng.ssm.service.support.trans.server.ebank.signQuery.model.out.SignQueryOutput;

/**
 * 签约账号查询
 *
 * @author zengwanlin
 * @date 2023-09-04T15:14
 */
@ServerHandler(sysCode = GxpConstant.SYS_CODE_EBANK, msgCode = GxpConstant.MSG_CODE_EBANK_0002, msgName = "签约账号查询", unRepeatable = false, loggingType = ClientHandler.LoggingType.TABLE)
public class SignQueryServerHandler extends BaseGxpServerHandler {

    /**
     * 获取请求实体类Class
     *
     * @return
     */
    @Override
    protected Class<? extends IBody> getRequestBodyClass() {
        return SignQueryInput.class;
    }

    /**
     * 初始化请求参数
     * <p>
     * 设置ContractId, DetailId, ProductNo等
     *
     * @return lock_key，用于加锁，为null时不加锁
     */
    @Override
    protected String initRequestParam() {
        component.setContractId(0);
        component.setDetailId(0);
        component.setProductNo("0");
        component.setReversal(false);
        return null;
    }

    /**
     * 处理业务逻辑
     */
    @Override
    protected IBody doService() {
        // 业务逻辑

        // 塞值
        SignQueryOutput output = new SignQueryOutput();
        output.setCustNo("96733907982");
        output.setCustName("四川天府银行股份有限公司");
        output.setSocialCode("7823594herj03479878");
        AcctNoItem acctNoItem = new AcctNoItem();
        acctNoItem.setAcctNo("98263752309732755");
        acctNoItem.setAcctNo("四川天府银行股份有限公司对公专户");
        acctNoItem.setBankNo("347862430974");
        acctNoItem.setBankName("四川天府银行股份有限公司");
        output.setAcctNoItemList(Lists.newArrayList(acctNoItem));
        return output;
    }
}
